package me.zhengjie.controller;

import lombok.RequiredArgsConstructor;
import me.zhengjie.log.aop.WebLog;
import me.zhengjie.pojo.dto.PlywoodDto;
import me.zhengjie.pojo.dto.QueryNestingDto;
import me.zhengjie.pojo.dto.SortingResultDto;
import me.zhengjie.pojo.vo.ReturnVo;
import me.zhengjie.service.WmsService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/wms")
@RequiredArgsConstructor
public class WmsController {
    private final WmsService wmsService;

    //2楼出库分拣回报
    @PostMapping("/sorting/result")
    @WebLog(description = "WMS回报2楼出库完成", logName = "WMS", category = "WMS")
    public ReturnVo sortingResult(@RequestBody SortingResultDto sortingResult){
        ReturnVo returnVo = wmsService.sortingResult(sortingResult);
        return returnVo;
    }

    @PostMapping("/plywood")
    public ReturnVo plywood(@RequestBody PlywoodDto plywoodDto){
        ReturnVo returnVo = wmsService.plywood(plywoodDto);
        return returnVo;
    }

    //wms发送容器编码查询嵌套信息
    @PostMapping("/query/nesting")
    public ReturnVo queryNesting(@RequestBody QueryNestingDto queryNestingDto){
        ReturnVo returnVo = wmsService.queryNesting(queryNestingDto);
        return returnVo;
    }
}
